package com.example.origin.base.controller;


import com.example.origin.advice.annotation.WrapResult;
import com.example.origin.aspect.annotation.Log;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 * @author yutao.zhang
 * @create 2023-07-20 15:48
 **/
@Slf4j
@RestController
public class BaseController {

    @Log(false)
    @WrapResult(value = false)
    @GetMapping("/acceptRequest")
    public void acceptRequest(int num) throws Exception {
        log.info("{} 接受到请求:num={}", Thread.currentThread().getName(), num);
        TimeUnit.SECONDS.sleep(2);
        if (1 == 1) {
            throw new RuntimeException();
        }
    }


}
